﻿<UserControl x:Class="WpfImageDuplicates.ImageCollectionView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:y="clr-namespace:WpfImageDuplicates"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              
             mc:Ignorable="d">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>        
        <ListBox Grid.Row="0" Name="lstItems" ItemsSource="{Binding}"  SelectionMode="Multiple" KeyDown="lstItems_KeyDown"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible">
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Visible" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Border Width="Auto" Height="Auto" BorderBrush="Black" BorderThickness="1,1,1,1">
                        <y:ThumbnailView x:Name="thumbnailView" Loaded="thumbnailView_Loaded" Padding="4,4,4,4" FileImageViewModel="{Binding}"  Width="Auto" Height="Auto"
                                         WantView="thumbnailView_WantView" Unloaded="thumbnailView_Unloaded"/>
                    </Border>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</UserControl>
